package com.xuecheng.content.service;

import com.xuecheng.commons.model.dto.CourseAuditDto;
import com.xuecheng.commons.model.dto.CourseBaseDto;
import com.xuecheng.commons.model.dto.CourseDto;
import com.xuecheng.commons.model.dto.PageRequest;
import com.xuecheng.commons.model.vo.CourseBaseVo;
import com.xuecheng.commons.model.vo.PageResponseResult;
import com.xuecheng.commons.model.vo.ResponseResult;
import com.xuecheng.content.domain.CourseBase;
import com.baomidou.mybatisplus.extension.service.IService;
import io.minio.errors.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;

/**
 * <p>
 * 课程基本信息 服务类
 * </p>
 *
 * @author itheima
 * @since 2022-09-17
 */
public interface CourseBaseService extends IService<CourseBase> {
    //分页查询所有课程
    PageResponseResult<CourseBase> findAll(CourseDto dto, PageRequest pageRequest);
    //上传课程封面图片
    ResponseResult<String> upload(MultipartFile uploadFile) throws IOException, Exception;
    //保存课程
    ResponseResult<CourseBaseVo> saveCourseBase(CourseBaseDto dto);
    //根据课程id删除课程
    ResponseResult deleteByCourseId(Long courseId);
    //修改课程
    ResponseResult<CourseBaseVo> updateCourseBase(CourseBaseDto dto);
    //机构提交课程
    ResponseResult commit(Long courseBaseId);
    //管理员审核课程
    ResponseResult approve(CourseAuditDto dto);
    //根据课程id下架已发布课程
    ResponseResult offline(Long courseId) throws Exception;
}
